package cn.amebius.simpledocker.entity.po;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * tb_role的Po类
 * @author 阿伟
 * @date 2023/7/28 16:01
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RolePo extends BasePo{

    private String name;

    private String designation;

    private String description;

    public static void check(RolePo rp) {
        if (rp == null || rp.name.isEmpty() || rp.designation.isEmpty() || rp.description.isEmpty()) {
            throw new DataErrorException("数据异常: 角色丢失");
        }
        BasePo.check(rp);
    }

}
